<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title>宽视场导航敏感器B</title>
  <link rel="stylesheet" href="/static/css/bootstrap.min.css">
  <link rel="stylesheet" href="/static/css/bbfont.css">
  <link rel="stylesheet" href="/static/css/style.css">
  <link rel="stylesheet" href="qv.css">

</head>
<body id="viewer" class="M1">
<div id="CCC" style="padding: 4px 6px;">
  <button class="btn btn-primary btn-sm disactive-btn" onclick="main.realtime()" id="realtime">实时</button>
  <button class="btn btn-primary btn-sm mx-1" id="history" onclick="main.history()">历史</button>
  日期:
  <input id="day" type="date" value="">
  任务:
  <select id="task" class="sele-comp">
    <!--    <option>TW2 GRAS AMAC 20240115095640 20240115122700</option>-->
  </select>
  最大帧: <label id="frm_max"></label>
  数据帧:
  <input id="frm_input" oninput="this.nextElementSibling.value=this.value" style="min-width: 60px" type="number">
  <input oninput="this.previousElementSibling.value=this.value"
         id="frm_range" type="range" min="0" max="0" value="0" step="1" style="max-width: 400px">
  <div class="flex-grow-1"></div>
  <button class="btn btn-primary btn-sm"  onclick="main.exportCSV(this)"><i class="fa fa-file-text"></i>下载帧信息</button>
</div>
<div class="d-flex d-flex flex-row" style="height: calc(100vh - 37px)">
  <div class="history position-relative">
    <div id="thumbs" class="h-100 w-100 p-1 position-absolute" style="overflow-y: auto">
    </div>
  </div>
  <div class="flex-grow-1 d-flex flex-column">
    <div id="ctrl" class="d-flex flex-row bg-light" style="height: 28px">
      <a class="fa fa-image btn  btn-r" onclick="$dld(main.cur_task,main.cur_frame.name+'.jpg')"></a>
      <!--      <a class="fa fa-download btn  btn-r" onclick="$dld(main.cur_task,main.cur_frame.name+'.tif')"></a>-->
      <label title="对比度" class="btn-r btn "><i class="fa fa-adjust"></i>
        <input type="range" value="1" min="0" max="2" step="0.01"></label>
      <label title="亮度" class="btn-r btn "><i class="fa fa-sun-o "></i>
        <input type="range" value="1" min="0" max="2" step="0.01"></label>
      <label title="色调" class="btn-r btn  visually-hidden"><i class="fa fa-dashboard "></i>
        <input type="range" value="0" min="0" max="360"> </label>
      <label title="饱和度" class="btn-r btn  visually-hidden"><i class="fa fa-certificate "></i>
        <input type="range" value="1" min="0" max="2" step="0.01"> </label>
      <button title="重置" class="btn-r btn " onclick="reset()">
        <i class="fa fa-refresh"></i>
        <i class="fa fa-circle-half"></i>
      </button>
      <span id="pos"></span>
      <span id="info"></span>

    </div>
    <div id="img-viewer" class="flex-grow-1">
      <div class="x-viewer" style="position: absolute;height: 100%;width: 100%;overflow: hidden">
        <img class="x-scale" id="frame_img" alt="" src=""></div>
    </div>
  </div>
  <div class="d-flex flex-column" style="width: 350px">
    <div class="card-header">
      数据
    </div>
    <div class="flex-grow-1  position-relative">
      <div class="position-absolute h-100 w-100" style="overflow-y: auto">
        <table id="params" class="table table-sm table-hover"></table>
      </div>
    </div>
  </div>
</div>
<script src="/static/js/jquery-3.6.0.min.js"></script>
<script src="/static/js/xtool.js?12"></script>
<script src="qv.js"></script>
<script src="cam-qv.js"></script>
<script>
  let params = [
    {n: "ID", k: 'id', v: new RawFmt('4X').X, r: '4X'},
    {n: "每行数据个数", k: 'linesize', r: '4X'},
    {n: "总图像行数", k: 'height', r: '4X'},
    {n: "当前图像列数", k: 'width', r: '4X'},
    {n: "像素位宽", k: 'bitwidth', r: '4X'},
    {n: "时间", k: 'ts', v: BJT, r: {fmt: () => ""}},
    {n: "成像起始时刻绝对星时秒部", k: 't_s', r: '8X', u: 's'},
    {n: "成像起始时刻绝对星时微秒部", k: 't_us', r: '8X', u: 'μs'},
    {n: "Tirg1长度寄存器", k: 'tirg1', r: '8X', u: 'μs'},
    {n: "Tirg2长度寄存器", k: 'tirg2', r: '8X', u: 'μs'},
    {n: "电机状态寄存器", k: 'djzt', r: '4X'},
    {n: "滤光轮角度", k: 'lgljd', r: '4X', u: '°'},
    {n: "调焦电机角度高", k: 'tjdjjdg', r: '8X'},
    {n: "调焦电机角度低", k: 'tjdjjdd', r: '8X'},
    {n: "图像帧号", k: 'cnt', r: '4X'},
    {n: "热敏电阻值1", k: 'rmdz1', r: '4X', u: 'Ω'},
    {n: "热敏电阻值2", k: 'rmdz2', r: '4X', u: 'Ω'},
    {n: "PGA寄存器", k: 'pga', r: '4X'},
    {n: "ADC寄存器", k: 'adc', r: '4X'},
    {n: "APS温度寄存器值", k: 'aps', r: '4X'},
    {n: "积分时间", k: 'jfsj', r: '8X', u: 'μs'},
    {n: "传图通道的状态", k: 'cttd', r: '4X'},
    {n: "工作模式", k: 'gzms', r: '4X'}
  ]
  var main = new CamViewer(ins = 'AWACB', params)
  main.realtime()
</script>
</body>
</html>